<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\MktUser */
/* @var $form yii\bootstrap\ActiveForm */
?>


<div class="mkt-user-form">

    <?php $form = ActiveForm::begin(); ?>

    <?php echo $form->errorSummary($model); ?>

    <?php echo $form->field($model, 'mobile')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'email')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'qq')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'weixin_number')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'parent_industry_id')->dropDownList(\yii\helpers\ArrayHelper::map(
        \common\models\MktIndustry::find()->children()->all(),
        'id',
        'title'
    ), ['prompt'=>'选择行业...', 'id'=>'parent_industry_id'])->label('行业'); ?>

    <?php echo $form->field($model, 'industry_id')->label('子行业')->widget(\kartik\depdrop\DepDrop::classname(), [
         'options' => ['id' => 'industry_id'],
         'pluginOptions'=>[
             'depends'=>['parent_industry_id'],
             'placeholder' => '选择子行业...',
             'url' => Url::to(['industry/subcat'])
         ]
     ]); ?>

    <?php echo $form->field($model, 'parent_area_id')->dropDownList(\yii\helpers\ArrayHelper::map(
        \common\models\MktArea::find()->children()->all(),
        'id',
        'title'
    ), ['prompt'=>'选择区域...', 'id'=>'parent_area_id'])->label('区域'); ?>

    <?php echo $form->field($model, 'area_id')->label('商圈')->widget(\kartik\depdrop\DepDrop::classname(), [
         'options' => ['id' => 'area_id'],
         'pluginOptions'=>[
             'depends'=>['parent_area_id'],
             'placeholder' => '选择商圈...',
             'url' => Url::to(['area/subcat'])
         ]
     ]); ?>

    <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'company')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'duty')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'password')->passwordInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'auth_key')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'password_hash')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'password_reset_token')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'access_token')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'disabled')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'status')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'create_time')->textInput() ?>

    <?php //echo $form->field($model, 'update_time')->textInput() ?>

    <?php //echo $form->field($model, 'openid')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'unionid')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'subscribe')->textInput() ?>

    <?php //echo $form->field($model, 'subscribe_time')->textInput() ?>

    <?php 
/*
    echo $form->field($model, 'create_time')->widget('trntv\yii\datetime\DateTimeWidget', [
            //'phpDatetimeFormat' => "YYYY-MM-DD h:mm:ss",
            'momentDatetimeFormat' => 'YYYY-MM-DD HH:mm:ss',
            'clientOptions' => [
                'minDate' => new \yii\web\JsExpression('new Date("2015-01-01")'),
                'allowInputToggle' => false,
                'sideBySide' => true,
                'locale' => 'zh-cn',
                'widgetPositioning' => [
                   'horizontal' => 'auto',
                   'vertical' => 'auto'
                ]
            ]
    ]); 
*/
    ?>

    <?php //echo $form->field($model, 'nickname')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'sex')->textInput() ?>

    <?php //echo $form->field($model, 'city')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'country')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'province')->textInput(['maxlength' => true]) ?>

    <?php //echo $form->field($model, 'headimgurl')->textInput(['maxlength' => true]) ?>

    <?php echo $form->field($model, 'on_message_post')->checkbox() ?>

    <?php echo $form->field($model, 'on_message_friend')->checkbox() ?>

    <?php echo $form->field($model, 'on_message_friend_log')->checkbox() ?>

    <?php echo $form->field($model, 'on_message_system')->checkbox() ?>

    <?php echo $form->field($model, 'on_quiet')->checkbox() ?>

    <?php echo $form->field($model, 'on_quiet_start_time')->textInput() ?>

    <?php /* echo $form->field($model, 'on_quiet_start_time')->widget(\kartik\time\TimePicker::classname(), [
        'pluginOptions' => [
            'showSeconds' => false,
            'showMeridian' => false,
        ]
    ]); */ ?>

    <?php echo $form->field($model, 'on_quiet_end_time')->textInput() ?>

    <?php /* echo $form->field($model, 'on_quiet_end_time')->widget(\kartik\time\TimePicker::classname(), [
        'pluginOptions' => [
            'showSeconds' => false,
            'showMeridian' => false,
        ]
    ]); */ ?>

    <?php echo $form->field($model, 'on_show_mobile')->checkbox() ?>

    <?php echo $form->field($model, 'on_show_qq')->checkbox() ?>

    <?php echo $form->field($model, 'on_show_weixin')->checkbox() ?>

    <?php echo $form->field($model, 'on_show_email')->checkbox() ?>

    <div class="form-group">
        <?php echo Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>

<?php
/*
        echo $form->field($model, 'create_time')->widget(\kartik\datetime\DateTimePicker::className(), [
            'options' => ['placeholder' => ''],
            'pluginOptions' => [
                'autoclose' => true,
                'format' => 'yyyy-mm-dd hh:ii:ss',
                'todayHighlight' => true
            ]
        ]);
    <?php //echo $form->field($model, 'area_id')->textInput(['maxlength' => true]) ?>


*/